Skip to content

Commit 66257cf

Browse files
Merge branch 'main' into utils/timestamp
2 parents 79ba593 + d602cc5 commit 66257cf

File tree

87 files changed

+533
-14748
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

87 files changed

+533
-14748
lines changed

README.md

+21-9
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,33 @@
1-
# [Arkiver](https://docs.arkiver.net)
1+
![Arkiver Logo](./img/arkiver_logo.png)
2+
3+
# Arkiver
4+
Seamlessly Develop, Deploy & Manage Data Pipelines for Web3 Applications
25

36
Fast and Fully Type-Safe Blockchain Indexer
47

8+
# Links
9+
- [Arkiver App](https://arkiver.net)
10+
- [Docs](https://www.arkiver.net/docs/intro)
11+
- [Quickstart](https://www.arkiver.net/docs/examples/index-erc20-events)
12+
513
# Features
614

7-
- **Fast** - Maximize indexing speed by minimizing I/O and caching data in
8-
memory
15+
- **Fast** - Maximize indexing speed by minimizing I/O and caching data in memory
916
- **Type-Safe** - End-to-end type-safety with TypeScript
1017
- **Flexible** - Write custom handlers to process data however you want
1118
- **Ergonomic** - Minimal configuration and easy to test locally
1219
- **Multi-Chain** - Index multiple chains in a single Arkive
1320
- **GraphQL** - Serve your data via a GraphQL API
1421
- **Open-Source** - Arkiver is open-source and free to use
1522
- **Self-Hosted** - Run Arkiver on your own infrastructure
16-
- **Cloud-Hosted** - Deploy your Arkive to the Arkiver cloud
23+
- **Cloud-Hosted** - Deploy your Arkive to the Arkiver Hosted Service
24+
25+
### Pick your use-case
26+
27+
Deploy Next.js, Svelte, Remix, Astro, Solid, or any static site to AWS.
1728

18-
... and a lot more!
29+
- [**ERC20 Events**](https://www.arkiver.net/docs/examples/index-erc20-events)
30+
- [**Vault Share Price**](https://www.arkiver.net/docs/examples/block-handler-vault-snapshot)
1931

2032
# Overview
2133

@@ -38,10 +50,10 @@ manifest
3850
export default manifest.build()
3951
```
4052

41-
# Documentation
42-
43-
[(WIP)](https://docs.arkiver.net)
44-
4553
# License
4654

4755
[MIT](LICENSE) License
56+
57+
---
58+
59+
**Join our community** [Discord](https://discord.gg/robovault-865495351175282708) | [Twitter](https://twitter.com/robolabs_biz)

cli.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ command.command('logout', 'Logout from RoboArkiver').action(logout.action)
5151
// deploy
5252
command
5353
.command('deploy', 'Deploy arkive')
54-
.option('--public', 'Make arkive public')
54+
.option('--private', 'Make arkive private')
5555
.option('--major', 'Deploy as major version')
5656
.option('--env <env:string>', 'Environment to deploy to')
5757
.arguments('<dir:string>')

cli/deploy/mod.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { pkg } from './pkg.ts'
77
import { upload } from './upload.ts'
88

99
export const action = async (
10-
options: { public?: true; major?: true; env?: string },
10+
options: { private?: true; major?: true; env?: string },
1111
directory: string,
1212
) => {
1313
const dev = options.env?.toLowerCase() === 'dev'
@@ -80,7 +80,7 @@ export const action = async (
8080
}
8181

8282
const deployDev = async (
83-
options: { public?: true; major?: true },
83+
options: { private?: true; major?: true },
8484
directory: string,
8585
) => {
8686
const manifestPath = join(Deno.cwd(), directory, 'manifest.ts')

cli/deploy/upload.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export const upload = async (
77
pkgName: string,
88
tempPath: string,
99
manifest: ArkiveManifest,
10-
options: { public?: true; major?: true; env?: string },
10+
options: { private?: true; major?: true; env?: string },
1111
) => {
1212
spinner().text = 'Uploading...'
1313
const { session } = await getSupabaseClientAndLogin()
@@ -23,7 +23,7 @@ export const upload = async (
2323
'pkg',
2424
new File([await Deno.readFile(filePath)], pkgName),
2525
)
26-
if (options.public) {
26+
if (options.private === undefined) {
2727
formData.append('isPublic', 'on')
2828
}
2929
if (options.major) {

cli/start/mod.ts

+9-1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import { ArkiverMetadata } from '../../src/arkiver/arkive-metadata.ts'
1010
import { createManifestHandlers } from './logger.ts'
1111
import { colors, mongoose, SchemaComposer } from '../../src/deps.ts'
1212
import { logger } from '../../src/logger.ts'
13+
import { collectRpcUrls } from '../utils.ts'
14+
1315

1416
export const action = async (
1517
options: {
@@ -114,11 +116,17 @@ export const action = async (
114116
},
115117
})
116118

119+
// An RPC for our Arkive is going to be assigned at some point.
120+
// The order of assignment is as follows:
121+
// 1. CLI command line option -r, --rpc-url
122+
// 2. Env variables such as {CHAIN}_RPC_URL
123+
// 3. RPC url defined in manifest
124+
// 4. Default RPC of Viem
117125
const rpcUrls = options.rpcUrl?.reduce((acc, rpc) => {
118126
const [name, url] = rpc.split('=')
119127
acc[name] = url
120128
return acc
121-
}, {} as Record<string, string>) ?? {}
129+
}, {} as Record<string, string>) ?? collectRpcUrls() ?? {}
122130

123131
logger('arkiver').debug(`Connecting to database...`)
124132
const connectionString = options.mongoConnection ??

cli/utils.ts

+21
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SUPABASE_ANON_PUBLIC_KEY, SUPABASE_URL } from './constants.ts'
22
import { createClient, Input, Secret, z } from './deps.ts'
33
import { login } from './login/mod.ts'
44
import { spinner } from './spinner.ts'
5+
import { supportedChains } from '../src/chains.ts'
56

67
export const getEmail = async () => {
78
const email = await Input.prompt('✉️ Email:')
@@ -127,3 +128,23 @@ export const craftEndpoint = (
127128
majorVersion ? majorVersion + '/' : ''
128129
}graphql`
129130
}
131+
132+
export const getEnv = (key: string, defaultValue?: string): string => {
133+
const value = Deno.env.get(key)
134+
if (!value && !defaultValue) {
135+
throw new Error(`Missing environment variable: ${key}`)
136+
}
137+
return value || defaultValue || ''
138+
}
139+
140+
export const collectRpcUrls = () => {
141+
const rpcUrls: Record<string, string> = {}
142+
for (const chain of Object.keys(supportedChains)) {
143+
try {
144+
rpcUrls[chain] = getEnv(`${chain.toUpperCase()}_RPC_URL`)
145+
} catch (_e) {
146+
// ignore
147+
}
148+
}
149+
return rpcUrls
150+
}

deno.lock

+28
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/.gitignore

-20
This file was deleted.

docs/README.md

-45
This file was deleted.

docs/babel.config.js

-3
This file was deleted.

docs/blog/2019-05-28-first-blog-post.md

-14
This file was deleted.

docs/blog/2019-05-29-long-blog-post.md

-76
This file was deleted.

docs/blog/2021-08-01-mdx-blog-post.mdx

-20
This file was deleted.
Binary file not shown.

0 commit comments

Comments
 (0)