From fcc29b6a8b0389b1d677774f8870dec1f4d2e9bf Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Wed, 27 Jul 2022 22:06:21 -0700 Subject: [PATCH 1/6] update README --- README.md | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1a1b7f759..c36f87944 100644 --- a/README.md +++ b/README.md @@ -1,21 +1,23 @@ -# Outserv: Blockchain Search +# Outserv: Blockchain Search with GraphQL APIs Outserv enables you to run production grade GraphQL Search APIs over any blockchain data 10x faster than existing mechanisms. -Outserv is the only system which combines the power of a saerch engine, a cache +Outserv is the only system which combines the power of a search engine, a cache engine and a GraphQL layer, thus replacing three different systems in production. -Outserv makes it trivial for anyone to bring up a production grade -GraphQL tech stack -- which we consider to be an important step to web3 -decentralization. +With a single executable binary, Outserv makes it trivial for anyone to bring up +a production grade GraphQL tech stack -- which we consider to be an important +step towards web3 decentralization. ![Outserv Comparison Image](/static/outserv.jpeg) ## Documentation: Installation and Usage -Please follow the documentation in +Please read the announcement [blog post +here](https://manishrjain.com/outserv-graphql-blockchain-search). And follow the +documentation at [https://docs.outcaste.io](https://docs.outcaste.io/docs/intro). ## Bugs / Feature Requests From 05958617298a4b768866e3a96589018e86e1c40e Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Wed, 27 Jul 2022 22:08:14 -0700 Subject: [PATCH 2/6] self review --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c36f87944..7b0eb4640 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ following questions: 1. What is the problem you are trying to solve for? 2. What did you do? -3. What did you expect? +3. What did you expect to see? 4. What did you see instead? ## License From 48ab29359991db56d59d038f5fc2778c21035654 Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Wed, 27 Jul 2022 22:40:38 -0700 Subject: [PATCH 3/6] code to bump UID from boot loader --- outserv/cmd/alpha/run.go | 13 +++++++++++++ zero/zero.go | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) diff --git a/outserv/cmd/alpha/run.go b/outserv/cmd/alpha/run.go index 120750982..6dbdac232 100644 --- a/outserv/cmd/alpha/run.go +++ b/outserv/cmd/alpha/run.go @@ -8,6 +8,7 @@ import ( "context" "embed" "fmt" + "io/ioutil" "log" "math" "net" @@ -17,6 +18,7 @@ import ( "os" "os/exec" "os/signal" + "path" "path/filepath" "strconv" "strings" @@ -932,6 +934,17 @@ func run() { // StartRaftNodes loads up DQL schema from disk. This is important step // that's needed before GraphQL schema can be loaded in setupServer. worker.StartRaftNodes(worker.State.WALstore, bindall) + + // writeUIDFile in boot loader. + data, err := ioutil.ReadFile(path.Join(x.WorkerConfig.Dir.Posting, "max_uid")) + if err == nil { + maxUid, err := strconv.ParseUint(string(data), 0, 64) + if err == nil { + glog.Infof("Found Max UID in p directory: %#x\n", maxUid) + x.Check(zero.BumpMaxUid(context.Background(), maxUid)) + } + } + atomic.AddUint32(&initDone, 1) // initialization of the admin account can only be done after raft nodes are running diff --git a/zero/zero.go b/zero/zero.go index 49ef3c955..762de6074 100644 --- a/zero/zero.go +++ b/zero/zero.go @@ -7,6 +7,7 @@ import ( "context" "crypto/tls" "fmt" + "math" "os" "time" @@ -298,6 +299,29 @@ func AssignUids(ctx context.Context, num uint32) (*pb.AssignedIds, error) { return &pb.AssignedIds{StartId: end - uint64(num), EndId: end - 1}, nil } +func BumpMaxUid(ctx context.Context, maxUid uint64) error { + for { + ms, err := LatestMembershipState(ctx) + if err != nil { + return errors.Wrapf(err, "while retrieving latest membership state") + } + if maxUid <= ms.MaxUID { + glog.Infof("ms.MaxUID: %#x >= maxUid: %#x. Returning from BumpMaxUid", + ms.MaxUID, maxUid) + return nil + } + ask := uint32(maxUid - ms.MaxUID) + if maxUid-ms.MaxUID >= math.MaxUint32 { + ask = uint32(math.MaxUint32) + } + glog.Infof("ms.MaxUID: %#x maxUid: %#x Assigning %#x UIDs\n", + ms.MaxUID, maxUid, ask) + if _, err := AssignUids(ctx, ask); err != nil { + return errors.Wrapf(err, "while assigning UIDS") + } + } +} + func AssignNsids(ctx context.Context, num uint32) (*pb.AssignedIds, error) { prop := &pb.ZeroProposal{NumNsids: num} st, err := ProposeAndWait(ctx, prop) From 8663bb85754a187805da9678987158135e5d48e8 Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Thu, 28 Jul 2022 09:02:51 -0700 Subject: [PATCH 4/6] update README --- README.md | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 7b0eb4640..7ff8d211f 100644 --- a/README.md +++ b/README.md @@ -13,12 +13,16 @@ step towards web3 decentralization. ![Outserv Comparison Image](/static/outserv.jpeg) -## Documentation: Installation and Usage +## Important Links -Please read the announcement [blog post -here](https://manishrjain.com/outserv-graphql-blockchain-search). And follow the -documentation at -[https://docs.outcaste.io](https://docs.outcaste.io/docs/intro). +- Read the announcement [blog post +here](https://manishrjain.com/outserv-graphql-blockchain-search) +- Follow the documentation at [https://docs.outcaste.io](https://docs.outcaste.io/docs/intro) +- See the [product roadmap here](https://github.com/outcaste-io/outserv/issues/61) +- Join the Outserv [Discord community](https://discord.gg/rmJnNd4XaV) +- Consult with me to figure if Outserv would be a good solution +for you via this [Calendly +link](https://calendly.com/manishrjain/consulting-on-outserv). ## Bugs / Feature Requests @@ -43,3 +47,11 @@ The monetization model mentioned in the Sustainable License is explained Certain portions of this project are licensed by contributors or others under the terms of open source licenses such as the Apache License v2.0. +## Join the Community + +If you'd like to consult with me to figure if Outserv would be a good solution +for you, please use this [Calendly +link](https://calendly.com/manishrjain/consulting-on-outserv). + +here. + From df4a00a0f16e8bf17bd1eefc015a05d87a8f4567 Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Thu, 28 Jul 2022 09:17:37 -0700 Subject: [PATCH 5/6] Deal with bumping of max_uid --- README.md | 18 +++++------------- outserv/cmd/alpha/run.go | 7 ++++++- zero/zero.go | 6 +++--- 3 files changed, 14 insertions(+), 17 deletions(-) diff --git a/README.md b/README.md index 7ff8d211f..dd1dd3f06 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ engine and a GraphQL layer, thus replacing three different systems in production. With a single executable binary, Outserv makes it trivial for anyone to bring up -a production grade GraphQL tech stack -- which we consider to be an important +a production grade GraphQL tech stack -- which I consider to be an important step towards web3 decentralization. ![Outserv Comparison Image](/static/outserv.jpeg) @@ -16,10 +16,10 @@ step towards web3 decentralization. ## Important Links - Read the announcement [blog post -here](https://manishrjain.com/outserv-graphql-blockchain-search) -- Follow the documentation at [https://docs.outcaste.io](https://docs.outcaste.io/docs/intro) -- See the [product roadmap here](https://github.com/outcaste-io/outserv/issues/61) -- Join the Outserv [Discord community](https://discord.gg/rmJnNd4XaV) +here](https://manishrjain.com/outserv-graphql-blockchain-search). +- Follow the documentation at [https://docs.outcaste.io](https://docs.outcaste.io/docs/intro). +- See the [product roadmap here](https://github.com/outcaste-io/outserv/issues/61). +- Join the Outserv [Discord community](https://discord.gg/rmJnNd4XaV). - Consult with me to figure if Outserv would be a good solution for you via this [Calendly link](https://calendly.com/manishrjain/consulting-on-outserv). @@ -47,11 +47,3 @@ The monetization model mentioned in the Sustainable License is explained Certain portions of this project are licensed by contributors or others under the terms of open source licenses such as the Apache License v2.0. -## Join the Community - -If you'd like to consult with me to figure if Outserv would be a good solution -for you, please use this [Calendly -link](https://calendly.com/manishrjain/consulting-on-outserv). - -here. - diff --git a/outserv/cmd/alpha/run.go b/outserv/cmd/alpha/run.go index 6dbdac232..bdacd6b94 100644 --- a/outserv/cmd/alpha/run.go +++ b/outserv/cmd/alpha/run.go @@ -938,11 +938,16 @@ func run() { // writeUIDFile in boot loader. data, err := ioutil.ReadFile(path.Join(x.WorkerConfig.Dir.Posting, "max_uid")) if err == nil { - maxUid, err := strconv.ParseUint(string(data), 0, 64) + str := strings.TrimSpace(string(data)) + maxUid, err := strconv.ParseUint(str, 0, 64) if err == nil { glog.Infof("Found Max UID in p directory: %#x\n", maxUid) x.Check(zero.BumpMaxUid(context.Background(), maxUid)) + } else { + glog.Infof("Unable to parse max_uid. Got error: %v", err) } + } else { + glog.Infof("No max_uid file found. Got error: %v\n", err) } atomic.AddUint32(&initDone, 1) diff --git a/zero/zero.go b/zero/zero.go index 762de6074..860cdc32b 100644 --- a/zero/zero.go +++ b/zero/zero.go @@ -305,12 +305,12 @@ func BumpMaxUid(ctx context.Context, maxUid uint64) error { if err != nil { return errors.Wrapf(err, "while retrieving latest membership state") } - if maxUid <= ms.MaxUID { - glog.Infof("ms.MaxUID: %#x >= maxUid: %#x. Returning from BumpMaxUid", + if ms.MaxUID > maxUid { + glog.Infof("ms.MaxUID: %#x > maxUid: %#x. Returning from BumpMaxUid", ms.MaxUID, maxUid) return nil } - ask := uint32(maxUid - ms.MaxUID) + ask := uint32(maxUid + 1 - ms.MaxUID) if maxUid-ms.MaxUID >= math.MaxUint32 { ask = uint32(math.MaxUint32) } From 11184456b0e1f516da69fed9faaf93be8694ab87 Mon Sep 17 00:00:00 2001 From: Manish R Jain Date: Thu, 28 Jul 2022 09:20:53 -0700 Subject: [PATCH 6/6] Add release info --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index dd1dd3f06..1ef6eea09 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ step towards web3 decentralization. ## Important Links +- Latest release is in `release/v22.07` branch. - Read the announcement [blog post here](https://manishrjain.com/outserv-graphql-blockchain-search). - Follow the documentation at [https://docs.outcaste.io](https://docs.outcaste.io/docs/intro).