Skip to content

Commit

Permalink
chore: Remove 'InviteHuman' event (is replaced by RegisterHuman) + al…
Browse files Browse the repository at this point in the history
…l spaceneth related files
  • Loading branch information
jaensen committed Dec 16, 2024
1 parent 5e29bdf commit 0d52e5f
Show file tree
Hide file tree
Showing 19 changed files with 25 additions and 753 deletions.
24 changes: 0 additions & 24 deletions Circles.Index.CirclesV2/DatabaseSchema.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)");

Expand All @@ -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),
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -203,19 +192,6 @@ public class DatabaseSchema : IDatabaseSchema

public DatabaseSchema()
{
EventDtoTableMap.Add<InviteHuman>(("CrcV2", "InviteHuman"));
SchemaPropertyMap.Add(("CrcV2", "InviteHuman"),
new Dictionary<string, Func<InviteHuman, object?>>
{
{ "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<PersonalMint>(("CrcV2", "PersonalMint"));
SchemaPropertyMap.Add(("CrcV2", "PersonalMint"),
new Dictionary<string, Func<PersonalMint, object?>>
Expand Down
9 changes: 0 additions & 9 deletions Circles.Index.CirclesV2/Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 0 additions & 1 deletion Circles.Index.CirclesV2/LogParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
37 changes: 24 additions & 13 deletions Circles.Index.Common/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
1 change: 0 additions & 1 deletion Circles.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
Expand Down
182 changes: 0 additions & 182 deletions add-deploy-script-tp-v2-repo.sh

This file was deleted.

Loading

0 comments on commit 0d52e5f

Please sign in to comment.