@devtion/actions 0.0.0-8bb9489 → 0.0.0-9239207
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.mjs +322 -262
- package/dist/index.node.js +323 -261
- package/dist/types/src/helpers/constants.d.ts +5 -2
- package/dist/types/src/helpers/constants.d.ts.map +1 -1
- package/dist/types/src/helpers/contracts.d.ts.map +1 -1
- package/dist/types/src/helpers/crypto.d.ts +1 -0
- package/dist/types/src/helpers/crypto.d.ts.map +1 -1
- package/dist/types/src/helpers/database.d.ts +8 -0
- package/dist/types/src/helpers/database.d.ts.map +1 -1
- package/dist/types/src/helpers/security.d.ts +1 -1
- package/dist/types/src/helpers/security.d.ts.map +1 -1
- package/dist/types/src/helpers/storage.d.ts +1 -1
- package/dist/types/src/helpers/storage.d.ts.map +1 -1
- package/dist/types/src/helpers/utils.d.ts +34 -20
- package/dist/types/src/helpers/utils.d.ts.map +1 -1
- package/dist/types/src/helpers/verification.d.ts +3 -2
- package/dist/types/src/helpers/verification.d.ts.map +1 -1
- package/dist/types/src/helpers/vm.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/types/index.d.ts +9 -3
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/package.json +3 -4
- package/src/helpers/constants.ts +40 -32
- package/src/helpers/contracts.ts +3 -3
- package/src/helpers/database.ts +13 -0
- package/src/helpers/security.ts +8 -5
- package/src/helpers/services.ts +2 -2
- package/src/helpers/storage.ts +3 -3
- package/src/helpers/utils.ts +299 -254
- package/src/helpers/verification.ts +6 -6
- package/src/helpers/vm.ts +9 -4
- package/src/index.ts +3 -1
- package/src/types/index.ts +23 -3
package/src/helpers/vm.ts
CHANGED
|
@@ -5,7 +5,8 @@ import {
|
|
|
5
5
|
StopInstancesCommand,
|
|
6
6
|
TerminateInstancesCommand,
|
|
7
7
|
EC2Client,
|
|
8
|
-
RunInstancesCommandInput
|
|
8
|
+
RunInstancesCommandInput,
|
|
9
|
+
_InstanceType
|
|
9
10
|
} from "@aws-sdk/client-ec2"
|
|
10
11
|
import {
|
|
11
12
|
GetCommandInvocationCommand,
|
|
@@ -159,17 +160,17 @@ export const createEC2Instance = async (
|
|
|
159
160
|
diskType: DiskTypeForVM
|
|
160
161
|
): Promise<EC2Instance> => {
|
|
161
162
|
// Get the AWS variables.
|
|
162
|
-
const { amiId,
|
|
163
|
+
const { amiId, instanceProfileArn } = getAWSVariables()
|
|
163
164
|
|
|
164
165
|
// Parametrize the VM EC2 instance.
|
|
165
166
|
const params: RunInstancesCommandInput = {
|
|
166
167
|
ImageId: amiId,
|
|
167
|
-
InstanceType: instanceType,
|
|
168
|
+
InstanceType: instanceType as _InstanceType,
|
|
168
169
|
MaxCount: 1,
|
|
169
170
|
MinCount: 1,
|
|
170
171
|
// nb. to find this: iam -> roles -> role_name.
|
|
171
172
|
IamInstanceProfile: {
|
|
172
|
-
Arn:
|
|
173
|
+
Arn: instanceProfileArn
|
|
173
174
|
},
|
|
174
175
|
// nb. for running commands at the startup.
|
|
175
176
|
UserData: Buffer.from(commands.join("\n")).toString("base64"),
|
|
@@ -195,6 +196,10 @@ export const createEC2Instance = async (
|
|
|
195
196
|
{
|
|
196
197
|
Key: "Initialized",
|
|
197
198
|
Value: "false"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
Key: "ProjectName",
|
|
202
|
+
Value: process.env.AWS_TAG_VALUE
|
|
198
203
|
}
|
|
199
204
|
]
|
|
200
205
|
}
|
package/src/index.ts
CHANGED
|
@@ -23,6 +23,7 @@ export {
|
|
|
23
23
|
getContributionsCollectionPath,
|
|
24
24
|
getTimeoutsCollectionPath,
|
|
25
25
|
getOpenedCeremonies,
|
|
26
|
+
getAllCeremonies,
|
|
26
27
|
getCeremonyCircuits
|
|
27
28
|
} from "./helpers/database"
|
|
28
29
|
export {
|
|
@@ -51,7 +52,8 @@ export {
|
|
|
51
52
|
ec2InstanceTag,
|
|
52
53
|
vmConfigurationTypes,
|
|
53
54
|
vmBootstrapScriptFilename,
|
|
54
|
-
powersOfTauFiles
|
|
55
|
+
powersOfTauFiles,
|
|
56
|
+
contribHashRegex
|
|
55
57
|
} from "./helpers/constants"
|
|
56
58
|
export {
|
|
57
59
|
extractPrefix,
|
package/src/types/index.ts
CHANGED
|
@@ -17,14 +17,14 @@ import {
|
|
|
17
17
|
* @property {string} accessKeyId - the key identifier related to S3 APIs.
|
|
18
18
|
* @property {string} secretAccessKey - the secret access key related to S3 APIs.
|
|
19
19
|
* @property {string} region - the region where your buckets are located.
|
|
20
|
-
* @property {string}
|
|
20
|
+
* @property {string} instanceProfileArn - the EC2 instance profile the VM should use to access S3.
|
|
21
21
|
* @property {string} amiId - the AWS AMI ID (default to Amazon Linux 2).
|
|
22
22
|
*/
|
|
23
23
|
export type AWSVariables = {
|
|
24
24
|
accessKeyId: string
|
|
25
25
|
secretAccessKey: string
|
|
26
26
|
region: string
|
|
27
|
-
|
|
27
|
+
instanceProfileArn: string
|
|
28
28
|
amiId: string
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -190,7 +190,7 @@ export type VMConfiguration = {
|
|
|
190
190
|
/**
|
|
191
191
|
* Group information about the circuit contribution verification mechanism.
|
|
192
192
|
* @typedef {Object} CircuitContributionVerification
|
|
193
|
-
* @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism
|
|
193
|
+
* @property {CircuitContributionVerificationMechanism} cfOrVm - the mechanism chosen by the coordinator.
|
|
194
194
|
* @property {VMConfiguration} [vm] - the VM configuration specs.
|
|
195
195
|
*/
|
|
196
196
|
export type CircuitContributionVerification = {
|
|
@@ -652,3 +652,23 @@ export type CeremonySetupTemplate = {
|
|
|
652
652
|
CeremonySetupTemplateCircuitName
|
|
653
653
|
>
|
|
654
654
|
}
|
|
655
|
+
|
|
656
|
+
export type StringifiedBigInts =
|
|
657
|
+
| StringifiedBigInts[]
|
|
658
|
+
| string
|
|
659
|
+
| string[]
|
|
660
|
+
| string[][]
|
|
661
|
+
| string[][][]
|
|
662
|
+
| { [key: string]: StringifiedBigInts }
|
|
663
|
+
| null
|
|
664
|
+
|
|
665
|
+
export type BigIntVariants =
|
|
666
|
+
| BigIntVariants[]
|
|
667
|
+
| StringifiedBigInts
|
|
668
|
+
| bigint
|
|
669
|
+
| bigint[]
|
|
670
|
+
| bigint[][]
|
|
671
|
+
| bigint[][][]
|
|
672
|
+
| { [key: string]: BigIntVariants }
|
|
673
|
+
| Uint8Array
|
|
674
|
+
| null
|