diff --git a/Circles.Index.CirclesV2/DatabaseSchema.cs b/Circles.Index.CirclesV2/DatabaseSchema.cs index 994d68b..43cc490 100644 --- a/Circles.Index.CirclesV2/DatabaseSchema.cs +++ b/Circles.Index.CirclesV2/DatabaseSchema.cs @@ -11,9 +11,6 @@ public class DatabaseSchema : IDatabaseSchema public IEventDtoTableMap EventDtoTableMap { get; } = new EventDtoTableMap(); - public static readonly EventSchema InviteHuman = - EventSchema.FromSolidity("CrcV2", "event InviteHuman(address indexed inviter, address indexed invited);"); - public static readonly EventSchema PersonalMint = EventSchema.FromSolidity("CrcV2", "event PersonalMint(address indexed human, uint256 amount, uint256 startPeriod, uint256 endPeriod)"); @@ -38,10 +35,6 @@ public class DatabaseSchema : IDatabaseSchema EventSchema.FromSolidity("CrcV2", "event DiscountCost(address indexed account, uint256 indexed id, uint256 discountCost)"); - // - // public static readonly EventSchema TransferSingle = EventSchema.FromSolidity( - // "CrcV2", - // "event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 indexed id, uint256 value)"); public static readonly EventSchema TransferSingle = new("CrcV2", "TransferSingle", Keccak.Compute("TransferSingle(address,address,address,uint256,uint256)").BytesToArray(), [ new("blockNumber", ValueTypes.Int, true), @@ -127,10 +120,6 @@ public class DatabaseSchema : IDatabaseSchema public IDictionary<(string Namespace, string Table), EventSchema> Tables { get; } = new Dictionary<(string Namespace, string Table), EventSchema> { - { - ("CrcV2", "InviteHuman"), - InviteHuman - }, { ("CrcV2", "PersonalMint"), PersonalMint @@ -203,19 +192,6 @@ public class DatabaseSchema : IDatabaseSchema public DatabaseSchema() { - EventDtoTableMap.Add(("CrcV2", "InviteHuman")); - SchemaPropertyMap.Add(("CrcV2", "InviteHuman"), - new Dictionary> - { - { "blockNumber", e => e.BlockNumber }, - { "timestamp", e => e.Timestamp }, - { "transactionIndex", e => e.TransactionIndex }, - { "logIndex", e => e.LogIndex }, - { "transactionHash", e => e.TransactionHash }, - { "inviter", e => e.Inviter }, - { "invited", e => e.Invited } - }); - EventDtoTableMap.Add(("CrcV2", "PersonalMint")); SchemaPropertyMap.Add(("CrcV2", "PersonalMint"), new Dictionary> diff --git a/Circles.Index.CirclesV2/Events.cs b/Circles.Index.CirclesV2/Events.cs index 881c69e..dbb6d9d 100644 --- a/Circles.Index.CirclesV2/Events.cs +++ b/Circles.Index.CirclesV2/Events.cs @@ -44,15 +44,6 @@ public record PersonalMint( UInt256 StartPeriod, UInt256 EndPeriod) : IIndexEvent; -public record InviteHuman( - long BlockNumber, - long Timestamp, - int TransactionIndex, - int LogIndex, - string TransactionHash, - string Inviter, - string Invited) : IIndexEvent; - public record Trust( long BlockNumber, long Timestamp, diff --git a/Circles.Index.CirclesV2/LogParser.cs b/Circles.Index.CirclesV2/LogParser.cs index 8af612b..b107606 100644 --- a/Circles.Index.CirclesV2/LogParser.cs +++ b/Circles.Index.CirclesV2/LogParser.cs @@ -15,7 +15,6 @@ public class LogParser(Address v2HubAddress, Address erc20LiftAddress) : ILogPar private readonly Hash256 _trustTopic = new(DatabaseSchema.Trust.Topic); - // private readonly Hash256 _inviteHumanTopic = new(DatabaseSchema.InviteHuman.Topic); private readonly Hash256 _personalMintTopic = new(DatabaseSchema.PersonalMint.Topic); private readonly Hash256 _registerHumanTopic = new(DatabaseSchema.RegisterHuman.Topic); private readonly Hash256 _registerGroupTopic = new(DatabaseSchema.RegisterGroup.Topic); diff --git a/Circles.Index.Common/Settings.cs b/Circles.Index.Common/Settings.cs index 6031a17..ca20c18 100644 --- a/Circles.Index.Common/Settings.cs +++ b/Circles.Index.Common/Settings.cs @@ -11,27 +11,38 @@ public class Settings public readonly Address CirclesV2HubAddress = Environment.GetEnvironmentVariable("V2_HUB_ADDRESS") != null ? new(Environment.GetEnvironmentVariable("V2_HUB_ADDRESS")!) : throw new Exception("V2_HUB_ADDRESS is not set."); - - public readonly Address CirclesNameRegistryAddress = Environment.GetEnvironmentVariable("V2_NAME_REGISTRY_ADDRESS") != null - ? new(Environment.GetEnvironmentVariable("V2_NAME_REGISTRY_ADDRESS")!) - : throw new Exception("V2_NAME_REGISTRY_ADDRESS is not set."); - - public readonly Address CirclesErc20LiftAddress = Environment.GetEnvironmentVariable("V2_ERC20_LIFT_ADDRESS") != null - ? new(Environment.GetEnvironmentVariable("V2_ERC20_LIFT_ADDRESS")!) - : throw new Exception("V2_ERC20_LIFT_ADDRESS is not set."); - - public readonly Address CirclesStandardTreasuryAddress = Environment.GetEnvironmentVariable("V2_STANDARD_TREASURY_ADDRESS") != null - ? new(Environment.GetEnvironmentVariable("V2_STANDARD_TREASURY_ADDRESS")!) - : throw new Exception("V2_STANDARD_TREASURY_ADDRESS is not set."); + + public readonly Address CirclesNameRegistryAddress = + Environment.GetEnvironmentVariable("V2_NAME_REGISTRY_ADDRESS") != null + ? new(Environment.GetEnvironmentVariable("V2_NAME_REGISTRY_ADDRESS")!) + : throw new Exception("V2_NAME_REGISTRY_ADDRESS is not set."); + + public readonly Address CirclesErc20LiftAddress = + Environment.GetEnvironmentVariable("V2_ERC20_LIFT_ADDRESS") != null + ? new(Environment.GetEnvironmentVariable("V2_ERC20_LIFT_ADDRESS")!) + : throw new Exception("V2_ERC20_LIFT_ADDRESS is not set."); + + public readonly Address CirclesStandardTreasuryAddress = + Environment.GetEnvironmentVariable("V2_STANDARD_TREASURY_ADDRESS") != null + ? new(Environment.GetEnvironmentVariable("V2_STANDARD_TREASURY_ADDRESS")!) + : throw new Exception("V2_STANDARD_TREASURY_ADDRESS is not set."); public readonly string IndexDbConnectionString = Environment.GetEnvironmentVariable("POSTGRES_CONNECTION_STRING") ?? throw new Exception("POSTGRES_CONNECTION_STRING is not set."); - + public readonly long StartBlock = Environment.GetEnvironmentVariable("START_BLOCK") != null ? long.Parse(Environment.GetEnvironmentVariable("START_BLOCK")!) : 0L; + public readonly int MaxRetries = Environment.GetEnvironmentVariable("MAX_RETRIES") != null + ? int.Parse(Environment.GetEnvironmentVariable("MAX_RETRIES")!) + : 3; + + public readonly int MaxRetryDelayJitter = Environment.GetEnvironmentVariable("MAX_RETRY_DELAY_JITTER") != null + ? int.Parse(Environment.GetEnvironmentVariable("MAX_RETRY_DELAY_JITTER")!) + : 2500; + public readonly int BlockBufferSize = 20000; public readonly int EventBufferSize = 100000; diff --git a/Circles.sln b/Circles.sln index 6114a4c..e947e1d 100644 --- a/Circles.sln +++ b/Circles.sln @@ -16,7 +16,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Circles.Index.CirclesV2", " EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "docker", "docker", "{B30CB76D-01EE-4E92-AEE5-27224DA53350}" ProjectSection(SolutionItems) = preProject - x64.debug.spaceneth.Dockerfile = x64.debug.spaceneth.Dockerfile x64.Dockerfile = x64.Dockerfile arm64.Dockerfile = arm64.Dockerfile docker-compose.chiado.yml = docker-compose.chiado.yml diff --git a/Readme.md b/Readme.md index 0643b52..552f008 100644 --- a/Readme.md +++ b/Readme.md @@ -408,8 +408,7 @@ Tables for batch events have an additional `batchIndex` column. * `Avatars` (view combining `Signup` and `OrganizationSignup`) * `TrustRelations` (view filtered to represent all current `Trust` relations) #### V_CrcV2 (Circles v2 views) - * `V_CrcV2_InviteHuman` (view combining CrcV2_Trust and CrcV2_RegisterHuman) - * `Avatars` (view combining `CrcV2_RegisterHuman`, `V_CrcV2_InviteHuman`, `CrcV2_RegisterGroup` and + * `Avatars` (view combining `CrcV2_RegisterHuman`, `CrcV2_RegisterGroup` and `CrcV2_RegisterOrganization`) * `TrustRelations` (view filtered to represent all current `Trust` relations) * `Transfers` (view combining `CrcV2_TransferBatch`, `CrcV2_TransferSingle` and `CrcV2_Erc20WrapperTransfer`) diff --git a/add-deploy-script-tp-v2-repo.sh b/add-deploy-script-tp-v2-repo.sh deleted file mode 100755 index 64bccd9..0000000 --- a/add-deploy-script-tp-v2-repo.sh +++ /dev/null @@ -1,182 +0,0 @@ -# Write an additional deployment script to the circles-contracts-v2 repository. -cat << 'EOF' > ./circles-contracts-v2/script/deployments/genericDeploy.sh - #!/bin/bash - - # Function to deploy contract and store deployment details - deploy_and_store_details() { - local contract_name=$1 - local precalculated_address=$2 - local deployment_output - local deployed_address - - echo "" >&2 - echo "Deploying ${contract_name}..." >&2 - deployment_output=$(forge create \ - --rpc-url ${RPC_URL} \ - --private-key ${PRIVATE_KEY} \ - --optimizer-runs 200 \ - --chain-id ${CHAIN_ID} \ - --delay 10 \ - "${@:3}") # Passes all arguments beyond the second to forge create - - deployed_address=$(echo "$deployment_output" | grep "Deployed to:" | awk '{print $3}') - echo "${contract_name} deployed at ${deployed_address}" >&2 - - # Verify that the deployed address matches the precalculated address - if [ "$deployed_address" = "$precalculated_address" ]; then - echo "Verification Successful: Deployed address matches the precalculated address for ${contract_name}." >&2 - else - echo "Verification Failed: Deployed address does not match the precalculated address for ${contract_name}." >&2 - echo "Precalculated Address: $precalculated_address" >&2 - echo "Deployed Address: $deployed_address" >&2 - # exit the script if the addresses don't match - exit 1 - fi - - # Define the filename for constructor arguments based on the contract name - arguments_file="constructorArgs_${contract_name}.txt" - arguments_path="${OUT_DIR}/${arguments_file}" - # Save constructor arguments to the file, skip "--constructor-args" - echo "${@:5}" > "${arguments_path}" - - # Store deployment details in a file - echo "{\"contractName\":\"${contract_name}\",\"deployedAddress\":\"${deployed_address}\",\"sourcePath\":\"$3\",\"constructor-args\":\"${@:5}\",\"argumentsFile\":\"${arguments_file}\"}" >> "${deployment_details_file}" - - # return the deployed address - echo "$deployed_address" - } - - # Function to generate a compact and short identifier - generate_identifier() { - # Fetch the current Git commit hash and take the first 7 characters - local git_commit_short=$(git rev-parse HEAD | cut -c1-7) - - # Get the current date and time in a compact format (YYMMDD-HMS) - local deployment_date=$1 - - # Fetch version from package.json - local version=$(node -p "require('./package.json').version") - - # Define the summary file name with version, short git commit, and compact date - echo "${version}-${git_commit_short}-${deployment_date}" - } - - # Set the environment variables, also for use in node script - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" - source "$DIR/../../.env" - - # fallback URI - URI='https://fallback.aboutcircles.com/v1/circles/{id}.json' - - export PRIVATE_KEY=$PRIVATE_KEY - export RPC_URL=$RPC_URL - - # Get the current date and time in a compact format (YYMMDD-HMS) outside the functions - deployment_date=$(date "+%y%m%d-%H%M%S") - deployment_date_long=$(date "+%Y-%m-%d %H:%M:%S") - identifier=$(generate_identifier $deployment_date) - - # Run the Node.js script to predict contract addresses - # Assuming predictAddresses.js is in the current directory - read DEPLOYER_ADDRESS NONCE_USED HUB_ADDRESS_01 MIGRATION_ADDRESS_02 NAMEREGISTRY_ADDRESS_03 \ - ERC20LIFT_ADDRESS_04 STANDARD_TREASURY_ADDRESS_05 BASE_GROUPMINTPOLICY_ADDRESS_06 \ - MASTERCOPY_DEMURRAGE_ERC20_ADDRESS_07 MASTERCOPY_INFLATIONARY_ERC20_ADDRESS_08 \ - MASTERCOPY_STANDARD_VAULT_09 \ - <<< $(node $DIR/predictDeploymentAddresses.js) - - # Create a directory for the deployment and go there after calling node script - mkdir -p "$DIR/generic-$identifier" - OUT_DIR="$DIR/generic-$identifier" - - # Use DEPLOYER_ADDRESS and NONCE_USED as needed - echo "Deployer Address: $DEPLOYER_ADDRESS, Nonce Used: $NONCE_USED" - - # Log the predicted deployment addresses - echo "Predicted deployment addresses:" - echo "===============================" - echo "Hub: \"${HUB_ADDRESS_01}\"," - echo "Migration: \"${MIGRATION_ADDRESS_02}\"," - echo "NameRegistry: \"${NAMEREGISTRY_ADDRESS_03}\"," - echo "ERC20Lift: \"${ERC20LIFT_ADDRESS_04}\"," - echo "StandardTreasury: \"${STANDARD_TREASURY_ADDRESS_05}\"," - echo "BaseGroupMintPolicy: \"${BASE_GROUPMINTPOLICY_ADDRESS_06}\"," - echo "MastercopyDemurrageERC20: \"${MASTERCOPY_DEMURRAGE_ERC20_ADDRESS_07}\"," - echo "MastercopyInflationaryERC20: \"${MASTERCOPY_INFLATIONARY_ERC20_ADDRESS_08}\"," - echo "MastercopyStandardVault: \"${MASTERCOPY_STANDARD_VAULT_09}\"" - - # Deploy the contracts - - export deployment_details_file="${OUT_DIR}/generic-artefacts-${identifier}.txt" - echo "Deployment details will be stored in $deployment_details_file" - - echo "" - echo "Starting deployment..." - echo "======================" - - HUB=$(deploy_and_store_details "Hub" $HUB_ADDRESS_01 \ - src/hub/Hub.sol:Hub \ - --constructor-args $V1_HUB_ADDRESS \ - $NAMEREGISTRY_ADDRESS_03 $MIGRATION_ADDRESS_02 $ERC20LIFT_ADDRESS_04 \ - $STANDARD_TREASURY_ADDRESS_05 $INFLATION_DAY_ZERO \ - $BOOTSTRAP_ONE_YEAR $URI) - - MIGRATION=$(deploy_and_store_details "Migration" $MIGRATION_ADDRESS_02 \ - src/migration/Migration.sol:Migration \ - --constructor-args $V1_HUB_ADDRESS $HUB_ADDRESS_01 $INFLATION_DAY_ZERO) - - NAME_REGISTRY=$(deploy_and_store_details "NameRegistry" $NAMEREGISTRY_ADDRESS_03 \ - src/names/NameRegistry.sol:NameRegistry \ - --constructor-args $HUB_ADDRESS_01) - - ERC20LIFT=$(deploy_and_store_details "ERC20Lift" $ERC20LIFT_ADDRESS_04 \ - src/lift/ERC20Lift.sol:ERC20Lift \ - --constructor-args $HUB_ADDRESS_01 \ - $NAMEREGISTRY_ADDRESS_03 $MASTERCOPY_DEMURRAGE_ERC20_ADDRESS_07 \ - $MASTERCOPY_INFLATIONARY_ERC20_ADDRESS_08) - - STANDARD_TREASURY=$(deploy_and_store_details "StandardTreasury" $STANDARD_TREASURY_ADDRESS_05 \ - src/treasury/StandardTreasury.sol:StandardTreasury \ - --constructor-args $HUB_ADDRESS_01 $MASTERCOPY_STANDARD_VAULT_09) - - BASE_MINTPOLICY=$(deploy_and_store_details "BaseGroupMintPolicy" $BASE_GROUPMINTPOLICY_ADDRESS_06 \ - src/groups/BaseMintPolicy.sol:MintPolicy) - - MC_ERC20_DEMURRAGE=$(deploy_and_store_details "MastercopyDemurrageERC20" $MASTERCOPY_DEMURRAGE_ERC20_ADDRESS_07 \ - src/lift/DemurrageCircles.sol:DemurrageCircles) - - MC_ERC20_INFLATION=$(deploy_and_store_details "MastercopyInflationaryERC20" $MASTERCOPY_INFLATIONARY_ERC20_ADDRESS_08 \ - src/lift/InflationaryCircles.sol:InflationaryCircles) - - MC_STANDARD_VAULT=$(deploy_and_store_details "MastercopyStandardVault" $MASTERCOPY_STANDARD_VAULT_09 \ - src/treasury/StandardVault.sol:StandardVault) - - # log to file - - # Use the function to generate the file name - summary_file="${OUT_DIR}/generic-${identifier}.log" - - # Now you can use $summary_file for logging - { - echo "generic deployment" - echo "=================" - echo "Deployment Date: $deployment_date_long" - echo "Version: $(node -p "require('./package.json').version")" - echo "Git Commit: $(git rev-parse HEAD)" - echo "Deployer Address: $DEPLOYER_ADDRESS, Intitial nonce: $NONCE_USED" - echo "Compiler Version: v0.8.23+commit.f704f362" # todo: figure out where to extract this from - echo "" - echo "Deployed Contracts:" - echo "Hub: ${HUB}" - echo "Migration: ${MIGRATION}" - echo "NameRegistry: ${NAME_REGISTRY}" - echo "ERC20Lift: ${ERC20LIFT}" - echo "StandardTreasury: ${STANDARD_TREASURY}" - echo "BaseGroupMintPolicy: ${BASE_MINTPOLICY}" - echo "MastercopyDemurrageERC20: ${MC_ERC20_DEMURRAGE}" - echo "MastercopyInflationaryERC20: ${MC_ERC20_INFLATION}" - echo "MastercopyStandardVault: ${MC_STANDARD_VAULT}" - } >> "$summary_file" -EOF - -# Ensure the script is executable -chmod +x ./circles-contracts-v2/script/deployments/genericDeploy.sh diff --git a/circles-chainspec.json b/circles-chainspec.json deleted file mode 100644 index 2b4ba24..0000000 --- a/circles-chainspec.json +++ /dev/null @@ -1,74 +0,0 @@ -{ - "name": "circles", - "dataDir": "circles", - "engine": { "NethDev": { "params": {} } }, - "params": { - "gasLimitBoundDivisor": "0x0400", - "accountStartNonce": "0x0", - "maximumExtraDataSize": "0x20", - "minGasLimit": "0x1388", - "networkID": "0xE6F2", - "eip150Transition": "0x0", - "eip160Transition": "0x0", - "eip161abcTransition": "0x0", - "eip161dTransition": "0x0", - "eip155Transition": "0x0", - "maxCodeSize": "0x6000", - "maxCodeSizeTransition": "0x0", - "eip140Transition": "0x0", - "eip211Transition": "0x0", - "eip214Transition": "0x0", - "eip658Transition": "0x0", - "eip145Transition": "0x0", - "eip1014Transition": "0x0", - "eip1052Transition": "0x0", - "eip152Transition": "0x0", - "eip1108Transition": "0x0", - "eip1344Transition": "0x0", - "eip1884Transition": "0x0", - "eip2028Transition": "0x0", - "eip2200Transition": "0x0", - "eip2565Transition": "0x0", - "eip2929Transition": "0x0", - "eip2930Transition": "0x0", - "eip1559Transition": "0x0", - "eip3198Transition": "0x0", - "eip3529Transition": "0x0", - "eip3541Transition": "0x0" - }, - "genesis": { - "seal": { "ethereum": { "nonce": "0x0000000000000042", "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000" } }, - "difficulty": "0x01", - "author": "0x0000000000000000000000000000000000000000", - "timestamp": "0x00", - "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000", - "extraData": "0x0000000000000000000000000000000000000000000000000000000000000000", - "gasLimit": "0x1000000" - }, - "nodes": [], - "accounts": { - "0000000000000000000000000000000000000000": { "balance": "1" }, - "0000000000000000000000000000000000000001": { "balance": "1", "nonce": "0", "builtin": { "name": "ecrecover", "pricing": { "linear": { "base": 3000, "word": 0 } } } }, - "0000000000000000000000000000000000000002": { "balance": "1", "nonce": "0", "builtin": { "name": "sha256", "pricing": { "linear": { "base": 60, "word": 12 } } } }, - "0000000000000000000000000000000000000003": { "balance": "1", "nonce": "0", "builtin": { "name": "ripemd160", "pricing": { "linear": { "base": 600, "word": 120 } } } }, - "0000000000000000000000000000000000000004": { "balance": "1", "nonce": "0", "builtin": { "name": "identity", "pricing": { "linear": { "base": 15, "word": 3 } } } }, - "0000000000000000000000000000000000000005": { "balance": "1", "nonce": "0", "builtin": { "name": "modexp", "activate_at": 1700000, "pricing": { "modexp": { "divisor": 20 } } } }, - "0000000000000000000000000000000000000006": { "balance": "1", "nonce": "0", "builtin": { "name": "alt_bn128_add", "activate_at": 1700000, "pricing": { "linear": { "base": 500, "word": 0 } } } }, - "0000000000000000000000000000000000000007": { "balance": "1", "nonce": "0", "builtin": { "name": "alt_bn128_mul", "activate_at": 1700000, "pricing": { "linear": { "base": 40000, "word": 0 } } } }, - "0000000000000000000000000000000000000008": { "balance": "1", "nonce": "0", "builtin": { "name": "alt_bn128_pairing", "activate_at": 1700000, "pricing": { "alt_bn128_pairing": { "base": 100000, "pair": 80000 } } } }, - "0000000000000000000000000000000000000009": { "balance": "1" }, - "913da4198e6be1d5f5e4a40d0667f70c0b5430eb": { "balance": "100000000000000000000000" }, - "fc2077ca7f403cbeca41b1b0f62d91b5ea631b5e": { "balance": "100000000000000000000000" }, - "d1a7451beb6fe0326b4b78e3909310880b781d66": { "balance": "100000000000000000000000" }, - "578270b5e5b53336bac354756b763b309eca90ef": { "balance": "100000000000000000000000" }, - "909f59835a5a120eafe1c60742485b7ff0e305da": { "balance": "100000000000000000000000" }, - "5711cED5ce6d91Ec7af3e5b02dDB47f409d42818": { "balance": "100000000000000000000000" }, - "02db23843DB65077E19757Af077648F106ae9243": { "balance": "100000000000000000000000" }, - "543289B0965Eba079b277B344DD1C0C2ab47a4bA": { "balance": "100000000000000000000000" }, - "1de55545a139b3BEc88301C87BA241323B0E5ae1": { "balance": "100000000000000000000000" }, - "d59feDEbbA13B004677004b79Dec7b60E4913AAc": { "balance": "100000000000000000000000" }, - "7E5F4552091A69125d5DfCb7b8C2659029395Bdf": { "balance": "100000000000000000000000000" }, - "2B5AD5c4795c026514f8317c7a215E218DcCD6cF": { "balance": "100000000000000000000000000" }, - "6813Eb9362372EEF6200f3b1dbC3f819671cBA69": { "balance": "100000000000000000000000000" } - } -} diff --git a/circles-config.cfg b/circles-config.cfg deleted file mode 100644 index a93fa55..0000000 --- a/circles-config.cfg +++ /dev/null @@ -1,54 +0,0 @@ -{ - "Init": { - "EnableUnsecuredDevWallet": true, - "KeepDevWalletInMemory": true, - "WebSocketsEnabled": false, - "DiscoveryEnabled": false, - "PeerManagerEnabled": false, - "ProcessingEnabled": true, - "IsMining": true, - "StoreReceipts": true, - "ChainSpecPath": "chainspec/circles.json", - "BaseDbPath": "spaceneth_db", - "LogFileName": "spaceneth.logs.txt" - }, - "Baseline": { - "Enabled": true - }, - "Sync": { - "NetworkingEnabled": false, - "SynchronizationEnabled": false - }, - "Network": { - "DiscoveryPort": 30303, - "P2PPort": 30303 - }, - "Mining": { - "Enabled": true - }, - "JsonRpc": { - "Enabled": true, - "Host": "0.0.0.0", - "Port": 8545, - "EnabledModules": ["Eth","Subscribe","Trace","TxPool","Web3","Personal","Proof","Net","Parity","Health","Rpc","Circles"] - }, - "TxPool": { - "Size": 128 - }, - "Db": { - "CacheIndexAndFilterBlocks": false - }, - "EthStats": { - "Enabled": false, - "Server": "ws://localhost:3000/api", - "Name": "Nethermind", - "Secret": "secret", - "Contact": "hello@nethermind.io" - }, - "Metrics": { - "Enabled": false, - "NodeName": "circles", - "PushGatewayUrl": "http://localhost:9091/metrics", - "IntervalSeconds": 5 - } -} diff --git a/circles-contracts b/circles-contracts deleted file mode 160000 index 8fb5b85..0000000 --- a/circles-contracts +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 8fb5b858190ce99429e7949a9cd8889b4747d258 diff --git a/circles-contracts-v2 b/circles-contracts-v2 deleted file mode 160000 index 6819670..0000000 --- a/circles-contracts-v2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 681967036477097441829562e173d5ee2403225d diff --git a/createFundedAccount.js b/createFundedAccount.js deleted file mode 100644 index 9533ef2..0000000 --- a/createFundedAccount.js +++ /dev/null @@ -1,50 +0,0 @@ -const ethers = require('ethers'); - -const provider = new ethers.JsonRpcProvider('http://localhost:8545'); - -async function createFundedAccount() { - - const accounts = await provider.listAccounts(); - const fundedAccountsWithKnownPrivateKey = []; - - for (const account of accounts) { - const balance = await provider.getBalance(account); - - if (balance < 1) { - continue; - } - - const mnemonicPhrase = "test test test test test test test test test test test junk"; - const nonce = await provider.getTransactionCount(account); - const path = `m/44'/60'/0'/0/${nonce}`; - const wallet = ethers.HDNodeWallet.fromMnemonic(ethers.Mnemonic.fromPhrase(mnemonicPhrase), path); - - const gasLimit = await provider.estimateGas({ - from: account.address, - to: wallet.address, - value: 1000000000000000000000n, - }); - - const tx = { - to: wallet.address, - value: 10000000000000000000000n, - gasPrice: 100n, - gasLimit: gasLimit, - }; - - const response = await account.sendTransaction(tx); - await response.wait(); - - fundedAccountsWithKnownPrivateKey.push(wallet); - - // We only need one funded account - break; - } - - for (const wallet of fundedAccountsWithKnownPrivateKey) { - console.log(`${wallet.privateKey}`); - break; - } -} - -createFundedAccount(); diff --git a/deploy.sh b/deploy.sh deleted file mode 100755 index 64d9e02..0000000 --- a/deploy.sh +++ /dev/null @@ -1,62 +0,0 @@ -RPC_URL=http://localhost:8545 -CHAIN_ID=59122 - -echo "Creating funded EOA..." -PRIVATE_KEY=$(node createFundedAccount.js) - -echo "Deploying v1 contracts ..." - -V1_HUB_INFLATION="107" -V1_HUB_PERIOD="31556952" -V1_HUB_SYMBOL="CRC" -V1_HUB_NAME="Circles" -V1_HUB_SIGNUP_BONUS="50000000000000000000" -V1_HUB_INITIAL_ISSUANCE="92592592592592" -V1_HUB_TIMEOUT="7776000" - -cd circles-contracts - -npm install @openzeppelin/contracts@^3.4.0-solc-0.7 -npm install @gnosis.pm/safe-contracts@^1.3.0 -npm install @circles/safe-contracts@=1.0.14 - -cd contracts - -V1_HUB_DEPLOYMENT=$(forge create Hub \ - --rpc-url ${RPC_URL} \ - --private-key ${PRIVATE_KEY} \ - --constructor-args ${V1_HUB_INFLATION} ${V1_HUB_PERIOD} ${V1_HUB_SYMBOL} ${V1_HUB_NAME} ${V1_HUB_SIGNUP_BONUS} ${V1_HUB_INITIAL_ISSUANCE} ${V1_HUB_TIMEOUT}) - -V1_HUB_ADDRESS=$(echo "$V1_HUB_DEPLOYMENT" | grep "Deployed to:" | awk '{print $3}') -echo "V1 Hub deployed at ${V1_HUB_ADDRESS}" - -# Set the current date at 00:00 as unix time -INFLATION_DAY_ZERO=$(date -d "00:00" +%s) -BOOTSTRAP_ONE_YEAR=31540000 - -cd ../.. - -echo "Writing .env file to circles-contracts-v2/.env ..." -cat < circles-contracts-v2/.env -PRIVATE_KEY=$PRIVATE_KEY -RPC_URL=$RPC_URL -CHAIN_ID=$CHAIN_ID -V1_HUB_ADDRESS=$V1_HUB_ADDRESS -INFLATION_DAY_ZERO=$INFLATION_DAY_ZERO -BOOTSTRAP_ONE_YEAR=$BOOTSTRAP_ONE_YEAR -VERIFIER_URL=https://localhost:8043 -EOF - -cd circles-contracts-v2/script/deployments/ - -echo "Installing dependencies ..." -npm i - -echo "Deploying Circles contracts ..." -./genericDeploy.sh - -cd ../../.. - -echo "Use this private key to interact with the contracts:" -PRIVATE_KEY=$(node createFundedAccount.js) -echo "PRIVATE_KEY=${PRIVATE_KEY}" diff --git a/envs/common-blockscout.env b/envs/common-blockscout.env deleted file mode 100644 index 26a54fd..0000000 --- a/envs/common-blockscout.env +++ /dev/null @@ -1,146 +0,0 @@ -# DOCKER_TAG= -ETHEREUM_JSONRPC_VARIANT=nethermind -ETHEREUM_JSONRPC_HTTP_URL=http://host.docker.internal:8545/ -DATABASE_URL=postgresql://postgres:@host.docker.internal:7432/blockscout?ssl=false -ETHEREUM_JSONRPC_TRACE_URL=http://host.docker.internal:8545/ -NETWORK=59122 -SUBNETWORK=Circles spaceneth -LOGO=/images/blockscout_logo.svg -LOGO_FOOTER=/images/blockscout_logo.svg -# ETHEREUM_JSONRPC_WS_URL= -ETHEREUM_JSONRPC_TRANSPORT=http -ETHEREUM_JSONRPC_DISABLE_ARCHIVE_BALANCES=false -IPC_PATH= -NETWORK_PATH=/ -API_PATH=/ -SOCKET_ROOT=/ -BLOCKSCOUT_HOST= -BLOCKSCOUT_PROTOCOL= -# SECRET_KEY_BASE= -# CHECK_ORIGIN= -PORT=4000 -COIN_NAME=Squares -# METADATA_CONTRACT= -# VALIDATORS_CONTRACT= -# KEYS_MANAGER_CONTRACT= -# REWARDS_CONTRACT= -# TOKEN_BRIDGE_CONTRACT= -EMISSION_FORMAT=DEFAULT -# CHAIN_SPEC_PATH= -# SUPPLY_MODULE= -COIN=Sqrs -EXCHANGE_RATES_COIN= -# EXCHANGE_RATES_SOURCE= -# EXCHANGE_RATES_COINGECKO_COIN_ID= -# EXCHANGE_RATES_COINGECKO_API_KEY= -# EXCHANGE_RATES_COINMARKETCAP_API_KEY= -POOL_SIZE=40 -POOL_SIZE_API=10 -ECTO_USE_SSL=false -# DATADOG_HOST= -# DATADOG_PORT= -# SPANDEX_BATCH_SIZE= -# SPANDEX_SYNC_THRESHOLD= -HEART_BEAT_TIMEOUT=30 -# HEART_COMMAND= -BLOCKSCOUT_VERSION= -RELEASE_LINK= -BLOCK_TRANSFORMER=base -# GRAPHIQL_TRANSACTION= -# BLOCK_RANGES= -# FIRST_BLOCK= -# LAST_BLOCK= -# TRACE_FIRST_BLOCK= -# TRACE_LAST_BLOCK= -LINK_TO_OTHER_EXPLORERS=false -OTHER_EXPLORERS={} -SUPPORTED_CHAINS={} -CACHE_BLOCK_COUNT_PERIOD=7200 -CACHE_TXS_COUNT_PERIOD=7200 -CACHE_ADDRESS_COUNT_PERIOD=7200 -CACHE_ADDRESS_SUM_PERIOD=3600 -CACHE_TOTAL_GAS_USAGE_PERIOD=3600 -CACHE_ADDRESS_TRANSACTIONS_GAS_USAGE_COUNTER_PERIOD=1800 -CACHE_TOKEN_HOLDERS_COUNTER_PERIOD=3600 -CACHE_TOKEN_TRANSFERS_COUNTER_PERIOD=3600 -CACHE_ADDRESS_WITH_BALANCES_UPDATE_INTERVAL=1800 -CACHE_AVERAGE_BLOCK_PERIOD=1800 -CACHE_MARKET_HISTORY_PERIOD=21600 -CACHE_ADDRESS_TRANSACTIONS_COUNTER_PERIOD=1800 -CACHE_ADDRESS_TOKENS_USD_SUM_PERIOD=1800 -CACHE_ADDRESS_TOKEN_TRANSFERS_COUNTER_PERIOD=1800 -CACHE_BRIDGE_MARKET_CAP_UPDATE_INTERVAL=1800 -CACHE_TOKEN_EXCHANGE_RATE_PERIOD=1800 -TOKEN_METADATA_UPDATE_INTERVAL=172800 -ALLOWED_EVM_VERSIONS=homestead,tangerineWhistle,spuriousDragon,byzantium,constantinople,petersburg,istanbul,berlin,london,default -UNCLES_IN_AVERAGE_BLOCK_TIME=false -DISABLE_WEBAPP=false -DISABLE_READ_API=false -DISABLE_WRITE_API=false -DISABLE_INDEXER=false -DISABLE_REALTIME_INDEXER=false -DISABLE_TOKEN_INSTANCE_FETCHER=false -INDEXER_DISABLE_PENDING_TRANSACTIONS_FETCHER=false -INDEXER_DISABLE_INTERNAL_TRANSACTIONS_FETCHER=false -# INDEXER_CATCHUP_BLOCKS_BATCH_SIZE= -# INDEXER_CATCHUP_BLOCKS_CONCURRENCY= -# WEBAPP_URL= -# API_URL= -WOBSERVER_ENABLED=false -SHOW_ADDRESS_MARKETCAP_PERCENTAGE=true -CHECKSUM_ADDRESS_HASHES=true -CHECKSUM_FUNCTION=eth -DISABLE_EXCHANGE_RATES=true -DISABLE_KNOWN_TOKENS=false -ENABLE_TXS_STATS=true -SHOW_PRICE_CHART=false -SHOW_TXS_CHART=true -HISTORY_FETCH_INTERVAL=30 -TXS_HISTORIAN_INIT_LAG=0 -TXS_STATS_DAYS_TO_COMPILE_AT_INIT=10 -COIN_BALANCE_HISTORY_DAYS=90 -APPS_MENU=true -EXTERNAL_APPS=[] -# GAS_PRICE= -# RESTRICTED_LIST= -# RESTRICTED_LIST_KEY= -SHOW_MAINTENANCE_ALERT=false -MAINTENANCE_ALERT_MESSAGE= -CUSTOM_CONTRACT_ADDRESSES_TEST_TOKEN= -ENABLE_SOURCIFY_INTEGRATION=false -SOURCIFY_SERVER_URL= -SOURCIFY_REPO_URL= -CHAIN_ID=59122 -MAX_SIZE_UNLESS_HIDE_ARRAY=50 -HIDE_BLOCK_MINER=false -DISPLAY_TOKEN_ICONS=false -SHOW_TENDERLY_LINK=false -TENDERLY_CHAIN_PATH= -MAX_STRING_LENGTH_WITHOUT_TRIMMING=2040 -RE_CAPTCHA_SECRET_KEY= -RE_CAPTCHA_CLIENT_KEY= -JSON_RPC= -API_RATE_LIMIT=50 -API_RATE_LIMIT_BY_KEY=50 -API_RATE_LIMIT_BY_IP=50 -API_RATE_LIMIT_WHITELISTED_IPS= -API_RATE_LIMIT_STATIC_API_KEY= -FETCH_REWARDS_WAY=trace_block -ENABLE_RUST_VERIFICATION_SERVICE=true -RUST_VERIFICATION_SERVICE_URL=http://host.docker.internal:8043/ -# DATABASE_READ_ONLY_API_URL= -# ACCOUNT_DATABASE_URL= -# ACCOUNT_POOL_SIZE= -# ACCOUNT_AUTH0_DOMAIN= -# ACCOUNT_AUTH0_CLIENT_ID= -# ACCOUNT_AUTH0_CLIENT_SECRET= -# ACCOUNT_AUTH0_LOGOUT_URL= -# ACCOUNT_AUTH0_LOGOUT_RETURN_URL= -# ACCOUNT_PUBLIC_TAGS_AIRTABLE_URL= -# ACCOUNT_PUBLIC_TAGS_AIRTABLE_API_KEY= -# ACCOUNT_SENDGRID_API_KEY= -# ACCOUNT_SENDGRID_SENDER= -# ACCOUNT_SENDGRID_TEMPLATE= -ACCOUNT_CLOAK_KEY= -ACCOUNT_ENABLED=false -ACCOUNT_REDIS_URL=redis://redis_db:6379 diff --git a/envs/common-smart-contract-verifier.env b/envs/common-smart-contract-verifier.env deleted file mode 100644 index 54ae2e7..0000000 --- a/envs/common-smart-contract-verifier.env +++ /dev/null @@ -1,20 +0,0 @@ -#SMART_CONTRACT_VERIFIER_DOCKER_TAG= -SMART_CONTRACT_VERIFIER__SERVER__ADDR=0.0.0.0:8043 - -SMART_CONTRACT_VERIFIER__SOLIDITY__ENABLED=true -SMART_CONTRACT_VERIFIER__SOLIDITY__COMPILERS_DIR=/tmp/solidity-compilers -SMART_CONTRACT_VERIFIER__SOLIDITY__REFRESH_VERSIONS_SCHEDULE=0 0 * * * * * -SMART_CONTRACT_VERIFIER__SOLIDITY__FETCHER__LIST__LIST_URL=https://solc-bin.ethereum.org/linux-amd64/list.json - -SMART_CONTRACT_VERIFIER__VYPER__ENABLED=true -SMART_CONTRACT_VERIFIER__VYPER__COMPILERS_DIR=/tmp/vyper-compilers -SMART_CONTRACT_VERIFIER__VYPER__FETCHER__LIST__LIST_URL=https://raw.githubusercontent.com/blockscout/solc-bin/main/vyper.list.json -SMART_CONTRACT_VERIFIER__VYPER__REFRESH_VERSIONS_SCHEDULE=0 0 * * * * * - -SMART_CONTRACT_VERIFIER__SOURCIFY__ENABLED=true -SMART_CONTRACT_VERIFIER__SOURCIFY__API_URL=https://sourcify.dev/server/ -SMART_CONTRACT_VERIFIER__SOURCIFY__VERIFICATION_ATTEMPTS=3 -SMART_CONTRACT_VERIFIER__SOURCIFY__REQUEST_TIMEOUT=10 - -SMART_CONTRACT_VERIFIER__METRICS__ENABLED=false -SMART_CONTRACT_VERIFIER__JAEGER__ENABLED=false diff --git a/general-example-requests.md b/general-example-requests.md index 94c0ec9..b501b85 100644 --- a/general-example-requests.md +++ b/general-example-requests.md @@ -54,7 +54,6 @@ The response generally contains the following fields: * `Trust` * `CrcV2_...` * `ApprovalForAll` - * `InviteHuman` * `PersonalMint` * `RegisterGroup` * `RegisterHuman` diff --git a/package.json b/package.json deleted file mode 100644 index 3b40d68..0000000 --- a/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "circles-nethermind", - "version": "1.0.0", - "description": "", - "main": "index.js", - "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" - }, - "dependencies": { - "ethers": "^6.11.1" - }, - "author": "", - "license": "UNLICENSED" -} diff --git a/time_controller.py b/time_controller.py deleted file mode 100644 index 052eca3..0000000 --- a/time_controller.py +++ /dev/null @@ -1,37 +0,0 @@ -from flask import Flask, request -import os -import signal -import subprocess - -app = Flask(__name__) - -nethermind_process = None - -@app.route('/set_time', methods=['POST']) -def set_time(): - fake_time = request.json.get('fake_time') - if fake_time: - os.environ['FAKETIME'] = fake_time - restart_nethermind() - return {'message': f'Fake time set to {fake_time}'} - else: - return {'error': 'No fake time provided'}, 400 - -def restart_nethermind(): - global nethermind_process - if nethermind_process: - nethermind_process.send_signal(signal.SIGTERM) - nethermind_process.wait() - - env = os.environ.copy() - env['LD_PRELOAD'] = '/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1' - env['FAKETIME_NO_CACHE'] = '1' - - nethermind_process = subprocess.Popen([ - './Nethermind.Runner', - '--config', 'circles' - ], env=env, cwd='/nethermind', preexec_fn=os.setsid) - -if __name__ == '__main__': - restart_nethermind() - app.run(host='0.0.0.0', port=5000) diff --git a/x64.debug.spaceneth.Dockerfile b/x64.debug.spaceneth.Dockerfile deleted file mode 100644 index c21019d..0000000 --- a/x64.debug.spaceneth.Dockerfile +++ /dev/null @@ -1,61 +0,0 @@ -FROM mcr.microsoft.com/dotnet/sdk:latest AS build -WORKDIR /src - -COPY . . - -RUN dotnet restore -RUN dotnet publish -c Debug -o /circles-nethermind-plugin - -FROM nethermind/nethermind:1.30.1 AS base - -# dotnet libs -COPY --from=build /circles-nethermind-plugin/Circles.Index.deps.json /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Common.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Common.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV1.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV1.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.NameRegistry.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.NameRegistry.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.StandardTreasury.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesV2.StandardTreasury.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesViews.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.CirclesViews.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Postgres.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Postgres.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Rpc.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Rpc.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Query.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Query.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Utils.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Index.Utils.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Pathfinder.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Circles.Pathfinder.pdb /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Nethermind.Int256.dll /nethermind/plugins -COPY --from=build /circles-nethermind-plugin/Npgsql.dll /nethermind/plugins - - -# FROM base AS circles-nethermind -# Install required packages -RUN apt-get update && \ - apt-get install -y libfaketime python3 python3-flask && \ - rm -rf /var/lib/apt/lists/* - -# Copy configuration files -COPY ./circles-chainspec.json /nethermind/chainspec/circles.json -COPY ./circles-config.cfg /nethermind/configs/circles.cfg - -# Set libfaketime to 'real time' -ENV FAKETIME="+0 x1" FAKETIME_NO_CACHE=1 - -# Copy the Python script for the API -COPY ./time_controller.py /app/time_controller.py - -# Expose the API port -EXPOSE 5000 - -# Start the API and Nethermind -ENTRYPOINT ["sh", "-c", "python3 /app/time_controller.py"]